﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Yunzuan.Foundation.Attributes;
using Yunzuan.Foundation.Entities;

namespace CloudDiamonds.Models.DBModels
{
    [Table(TableName = "yz_Inventory", PrimaryKey = "ID")]
    public class Inventory : BaseEntity
    {
        private string _cut;
        private decimal? _purchaseExchange;//01-09
        private decimal? _originUSDPerGrain; 
        private string _milky;
        private string _certNo;
        private string _comments;
        private decimal? _rapnet;
        private string _supplier;
        private string _hA;
        private string _measurementHeight;
        private int? _status;
        private string _hue;
        private DateTime _insertTime;
        private DateTime _updateTime;
        private string _originSN;
        private string _secondSN; 
        private decimal? _purchaseUSDPerCarat;//12-26
        private string _purchaseSupplier;//01-09
        private int? _receiptStatus;
        private string _measurementMin;
        private int? _onShelves;//上下架状态 12-23
        private string _otherDefect;
        private decimal? _purchaseDiscountReturn;//12-26 采购价三字段 备注属性
        private decimal? _originDiscountReturn;//12-26 采购价三字段 备注属性 
        private string _fluorescence;
        private DateTime? _purchaseTime;
        private decimal? _purchaseRMB;//01-09 
        private string _eyeClean;
        private string _blackDefect;
        private string _place;
        private decimal? _originUSDPerCarat; 
        private long? _id;
        private string _purchaseAgent;
        
        private DateTime? _shipTime;
        private short _isFancy;
        private string _symmetry;
        private decimal? _weight;
        private string _color; 
        private DateTime? _arrivalTime; 
        private string _certType;
        private string _measurementMax;
        private int _shape;
        private string _sn;
        private string _measurement;
        private string _polish;
        private string _shortName; 
        private string _clarity;
        private decimal? _purchaseUSDPerGrain;//----------------------------


        public int Tag { get; set; } //tinyint(1) NOT NULL DEFAULT '0' COMMENT '标签',

        #region 公共属性 
        public long? ID
        {
            get
            {
                return _id;
            }
            set
            {
                this.ChangeNotify<long?>("ID", value, ref _id);
            }
        }

        /// <summary>
        /// 供应商代码
        /// </summary>
        public string Supplier
        {
            get
            {
                return _supplier;
            }
            set
            {
                this.ChangeNotify<string>("Supplier", value, ref _supplier);
            }
        }

        /// <summary>
        /// 供货地点
        /// </summary>
        public string Place
        {
            get
            {
                return _place;
            }
            set
            {
                this.ChangeNotify<string>("Place", value, ref _place);
            }
        }

        public string SN
        {
            get { return _sn; }
            set
            {
                this.ChangeNotify<string>("SN", value, ref _sn);
            }
        }

        /// <summary>
        /// 源货号
        /// </summary>
        public string OriginSN
        {
            get { return _originSN; }
            set
            {
                this.ChangeNotify<string>("OriginSN", value, ref _originSN);
            }
        }

        /// <summary>
        /// 形状：1.圆形，2.梨形，3.心形...
        /// </summary>
        public int Shape
        {
            get
            {
                return _shape;
            }
            set
            {
                this.ChangeNotify<int>("Shape", value, ref _shape);
            }
        }

        public decimal? Weight
        {
            get
            {
                return _weight;
            }
            set
            {
                this.ChangeNotify<decimal?>("Weight", value, ref _weight);
            }
        }

        public string Color
        {
            get { return _color; }
            set { this.ChangeNotify<string>("Color", value, ref _color); }
        }

        public string Clarity
        {
            get { return _clarity; }
            set
            {
                this.ChangeNotify<string>("Clarity", value, ref _clarity);
            }
        }

        public string Cut
        {
            get { return _cut; }
            set { this.ChangeNotify<string>("Cut", value, ref _cut); }
        }

        /// <summary>
        /// 抛光
        /// </summary>
        public string Polish
        {
            get { return _polish; }
            set
            {
                this.ChangeNotify<string>("Polish", value, ref _polish);
            }
        }

        /// <summary>
        /// 对称
        /// </summary>
        public string Symmetry
        {
            get { return _symmetry; }
            set
            {
                this.ChangeNotify<string>("Symmetry", value, ref _symmetry);
            }
        }

        /// <summary>
        /// 对称
        /// </summary>
        public string Fluorescence
        {
            get { return _fluorescence; }
            set
            {
                this.ChangeNotify<string>("Fluorescence", value, ref _fluorescence);
            }
        }


        /// <summary>
        /// 证书类型
        /// </summary>
        public string CertType
        {
            get { return _certType; }
            set
            {
                this.ChangeNotify<string>("CertType", value, ref _certType);
            }
        }

        /// <summary>
        /// 证书类型
        /// </summary>
        public string CertNo
        {
            get { return _certNo; }
            set
            {
                this.ChangeNotify<string>("CertNo", value, ref _certNo);
            }
        }

        /// <summary>
        /// 台面羽状：None, fe, fe1, fe2, fe3
        /// </summary>
        public string Comments
        {
            get { return _comments; }
            set
            {
                this.ChangeNotify<string>("Comments", value, ref _comments);
            }
        }

        /// <summary>
        /// 奶色
        /// </summary>
        public string Milky
        {
            get { return _milky; }
            set
            {
                this.ChangeNotify<string>("Milky", value, ref _milky);
            }
        }


        /// <summary>
        /// OnShelves 上下架状态
        /// </summary>
        public int? OnShelves
        {
            get { return _onShelves; }
            set
            {
                this.ChangeNotify<int?>("OnShelves", value, ref _onShelves);
            }
        }

        /// <summary>
        /// 彩钻 0.否,1.是
        /// /// 
        /// </summary>
        public short IsFancy
        {
            get { return _isFancy; }
            set
            {
                this.ChangeNotify<short>("IsFancy", value, ref _isFancy);
            }
        }

        /// <summary>
        /// PurchaseDiscountReturn 采购退点
        /// </summary>
        public decimal? PurchaseDiscountReturn
        {
            get
            {
                return _purchaseDiscountReturn;
            }
            set
            {
                this.ChangeNotify<decimal?>("PurchaseDiscountReturn", value, ref _purchaseDiscountReturn);
            }
        }

        /// <summary>
        /// PurchaseUSDPerCarat 采购每卡价
        /// </summary>
        public decimal? PurchaseUSDPerCarat
        {
            get
            {
                return _purchaseUSDPerCarat;
            }
            set
            {
                this.ChangeNotify<decimal?>("PurchaseUSDPerCarat", value, ref _purchaseUSDPerCarat);
            }
        }


        /// <summary>
        /// PurchaseUSDPerGrain 采购总价
        /// </summary>
        public decimal? PurchaseUSDPerGrain
        {
            get
            {
                return _purchaseUSDPerGrain;
            }
            set
            {
                this.ChangeNotify<decimal?>("PurchaseUSDPerGrain", value, ref _purchaseUSDPerGrain);
            }
        }


        /// <summary>
        /// PurchaseRMB
        /// </summary>
        public decimal? PurchaseRMB
        {
            get
            {
                return _purchaseRMB;
            }
            set
            {
                this.ChangeNotify<decimal?>("PurchaseRMB", value, ref _purchaseRMB);
            }
        }

        /// <summary>
        /// PurchaseExchange
        /// </summary>
        public decimal? PurchaseExchange
        {
            get
            {
                return _purchaseExchange;
            }
            set
            {
                this.ChangeNotify<decimal?>("PurchaseExchange", value, ref _purchaseExchange);
            }
        }

        /// <summary>
        /// PurchaseSupplier
        /// </summary>
        public string PurchaseSupplier
        {
            get
            {
                return _purchaseSupplier;
            }
            set
            {
                this.ChangeNotify<string>("PurchaseSupplier", value, ref _purchaseSupplier);
            }
        }

         



        public DateTime InsertTime
        {
            get { return _insertTime; }
            set
            {
                this.ChangeNotify<DateTime>("InsertTime", value, ref _insertTime);
            }
        }

        public DateTime UpdateTime
        {
            get { return _updateTime; }
            set
            {
                this.ChangeNotify<DateTime>("UpdateTime", value, ref _updateTime);
            }
        }

        #endregion

        /// <summary>
        /// MeasurementMin
        /// </summary>
        public string MeasurementMin
        {
            get { return _measurementMin; }
            set
            {
                this.ChangeNotify<string>("MeasurementMin", value, ref _measurementMin);
            }
        }

        /// <summary>
        /// MeasurementMax
        /// </summary>
        public string MeasurementMax
        {
            get { return _measurementMax; }
            set
            {
                this.ChangeNotify<string>("MeasurementMax", value, ref _measurementMax);
            }
        }

        /// <summary>
        /// MeasurementHeight
        /// </summary>
        public string MeasurementHeight
        {
            get { return _measurementHeight; }
            set
            {
                this.ChangeNotify<string>("MeasurementHeight", value, ref _measurementHeight);
            }
        }

        /// <summary>
        /// Measurement
        /// </summary>
        public string Measurement
        {
            get { return _measurement; }
            set
            {
                this.ChangeNotify<string>("Measurement", value, ref _measurement);
            }
        }
         
        /// <summary>
        /// HA
        /// </summary>
        public string HA
        {
            get { return _hA; }
            set
            {
                this.ChangeNotify<string>("HA", value, ref _hA);
            }
        }

        /// <summary>
        /// Hue
        /// </summary>
        public string Hue
        {
            get { return _hue; }
            set
            {
                this.ChangeNotify<string>("Hue", value, ref _hue);
            }
        }


        /// <summary>
        /// BlackDefect
        /// </summary>
        public string BlackDefect
        {
            get { return _blackDefect; }
            set
            {
                this.ChangeNotify<string>("BlackDefect", value, ref _blackDefect);
            }
        }

        /// <summary>
        /// OtherDefect
        /// </summary>
        public string OtherDefect
        {
            get { return _otherDefect; }
            set
            {
                this.ChangeNotify<string>("OtherDefect", value, ref _otherDefect);
            }
        }

        /// <summary>
        /// 肉眼
        /// </summary>
        public string EyeClean
        {
            get { return _eyeClean; }
            set
            {
                this.ChangeNotify<string>("EyeClean", value, ref _eyeClean);
            }
        }



        public decimal? Rapnet
        {
            get
            {
                return _rapnet;
            }
            set
            {
                this.ChangeNotify<decimal?>("Rapnet", value, ref _rapnet);
            }
        }



        /// <summary>
        /// 数据状态：0.已删除, 1.正常, 2.订单中, 3.已售出
        /// </summary>
        public int? Status
        {
            get { return _status; }
            set
            {
                this.ChangeNotify<int?>("Status", value, ref _status);
            }
        }
        /// <summary>
        /// 付款状态：0未付 1，已付
        /// </summary>
        public int? ReceiptStatus
        {
            get { return _receiptStatus; }
            set
            {
                this.ChangeNotify<int?>("ReceiptStatus", value, ref _receiptStatus);
            }
        }
        
        public DateTime? PurchaseTime
        {
            get
            {
                if (_purchaseTime != null && Convert.ToDateTime(_purchaseTime.ToString()).Year > 1970)
                    return _purchaseTime;
                else
                    return null;
            }
            set
            {
                this.ChangeNotify<DateTime?>("PurchaseTime", value, ref _purchaseTime);

            }
        }
        public DateTime? ShipTime
        {
            get { return _shipTime; }
            set
            {
                this.ChangeNotify<DateTime?>("PurchaseTime", value, ref _shipTime);
            }
        }

        public decimal? OriginUSDPerGrain
        {
            get { return _originUSDPerGrain; }
            set
            {
                this.ChangeNotify<decimal?>("OriginUSDPerGrain", value, ref _originUSDPerGrain);
            }
        }
        public string SecondSN
        {
            get { return _secondSN; }
            set
            {
                this.ChangeNotify<string>("SecondSN", value, ref _secondSN);
            }
        }

        public decimal? OriginDiscountReturn
        {
            get { return _originDiscountReturn; }
            set
            {
                this.ChangeNotify<decimal?>("OriginDiscountReturn", value, ref _originDiscountReturn);
            }
        }
        public decimal? OriginUSDPerCarat
        {
            get { return _originUSDPerCarat; }
            set
            {
                this.ChangeNotify<decimal?>("OriginUSDPerCarat", value, ref _originUSDPerCarat);
            }
        }
        public string PurchaseAgent
        {
            get { return _purchaseAgent; }
            set
            {
                this.ChangeNotify<string>("PurchaseAgent", value, ref _purchaseAgent);
            }
        }

        public DateTime? ArrivalTime
        {
            get
            {
                if (_arrivalTime != null && Convert.ToDateTime(_arrivalTime.ToString()).Year > 1970)
                    return _arrivalTime;
                else
                    return null;
            }
            set
            {
                this.ChangeNotify<DateTime?>("ArrivalTime", value, ref _arrivalTime);
            }
        }

        public string ShortName
        {
            get { return _shortName; }
            set
            {
                this.ChangeNotify<string>("ShortName", value, ref _shortName);
            }
        }
    }
}
